﻿using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections;
using System.Drawing;
using System.Linq;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.Workflow.Runtime;
using System.Workflow.Activities;
using System.Workflow.Activities.Rules;

namespace TfsAlert.Workflows
{
    public sealed partial class RS232 : SequentialWorkflowActivity
    {
        public RS232()
        {
            InitializeComponent();
        }

        private bool _relayOn = false;

        #region WD Properties

        public static DependencyProperty RelayPortProperty = DependencyProperty.Register( "RelayPort", typeof( int ), typeof( RS232 ) );

        [DescriptionAttribute( "RelayPort" )]
        [CategoryAttribute( "RelayPort Category" )]
        [BrowsableAttribute( true )]
        [DesignerSerializationVisibilityAttribute( DesignerSerializationVisibility.Visible )]
        public int RelayPort
        {
            get
            {
                return ( (int)( base.GetValue( RS232.RelayPortProperty ) ) );
            }
            set
            {
                base.SetValue( RS232.RelayPortProperty, value );
            }
        }

        #endregion

        private void ActivateRelay_Invoked( object sender, ExternalDataEventArgs e )
        {
            this._relayOn = true;
        }

        private void TerminateRelay_Invoked( object sender, ExternalDataEventArgs e )
        {
            this._relayOn = false;
        }

    }

}
